AssignGridInteger Subroutine

private subroutine AssignGridInteger(mat, mask)

assign value of mask integer to mat integer

Arguments

Type IntentOptional Attributes Name
type(grid_integer), intent(inout) :: mat
type(grid_integer), intent(in) :: mask

Variables

Type Visibility Attributes Name Initial
integer, public :: i
integer, public :: j

Source Code

SUBROUTINE AssignGridInteger &
!
(mat, mask)

IMPLICIT NONE

!Arguments with intent(in):
TYPE(grid_integer),INTENT(IN) :: mask

!Arguments with intent (inout)
TYPE(grid_integer),INTENT(INOUT):: mat

!Local declarations:
INTEGER :: i,j

!---------------------------end of declarations--------------------------------

!check spatial reference
!IF ( .NOT. CRSisEqual (mask, mat, .TRUE.) ) THEN
IF ( .NOT. CRSisEqual (mask, mat) ) THEN
  CALL Catch ('error', 'GridOperations',  &
    'while assigning grid content from another grid: ',  &
     argument = 'spatial reference not equal' ) 
END IF

DO i = 1, mat % idim
  DO j = 1, mat % jdim
    IF (mat % mat (i,j) /= mat % nodata) THEN
      mat % mat(i,j) = mask % mat(i,j)
    END IF
  END DO
END DO

END SUBROUTINE AssignGridInteger